Filename: /text/sbasic/shared/03030130.xhp
(section: datepart)
(bookmark: bm_id249946)
DatePart function
DatePart 関数
DatePart Function [Runtime]
DatePart 関数 [実行時](par_idN10542.)
The DatePart function returns a specified part of a date.
DatePart 関数は、日付の指定された部分を返します。(par_idN10546.)
(/section: datepart)
Syntax:
構文:(par_idN10549.)
DatePart (Add, Date [, Week_start [, Year_start]])
DatePart (Add, Date [, Week_start [, Year_start]])(par_idN105E8.)
Return value:
戻り値:(par_idN105EB.)
A Variant containing a date.
日付を含むバリエーション。(par_idN105EF.)
Parameters:
パラメータ:(par_idN105F2.)
Add - A string expression from the following table, specifying the date interval.
Add - 日付の間隔を指定する、後続のテーブルからの文字列式。(par_idN105F6.)
(embed text/sbasic/shared/03030110.xhp#datetable : linkinfo)
|
Add (string value)
Add (文字列値)(par_idN10636.)
|
Explanation
説明(par_idN1063C.)
|
|
yyyy
Yyyy(par_idN10643.)
|
Year
年(par_idN10649.)
|
|
q
q(par_idN10650.)
|
Quarter
四半期(par_idN10656.)
|
|
m
m(par_idN1065D.)
|
Month
月(par_idN10663.)
|
|
y
y(par_idN1066A.)
|
Day of year
年内の通算日(par_idN10670.)
|
|
w
w(par_idN10677.)
|
Weekday
平日(par_idN1067D.)
|
|
ww
ww(par_idN10684.)
|
Week of year
週(par_idN1068A.)
|
|
d
d(par_idN10691.)
|
Day
日(par_idN10697.)
|
|
h
h(par_idN1069E.)
|
Hour
時(par_idN106A4.)
|
|
n
n(par_idN106AB.)
|
Minute
分(par_idN106B1.)
|
|
s
s(par_idN106B8.)
|
Second
秒(par_idN106BE.)
|
(/embed text/sbasic/shared/03030110.xhp#datetable)
Date - The date from which the result is calculated.
Date - 結果の計算元の日付。(par_idN10604.)
(embed text/sbasic/shared/03030120.xhp#weekyear : linkinfo)
Week_start - An optional parameter that specifies the starting day of a week.
Week_start - 週の開始曜日を指定するオプションのパラメータ。 (par_idN1066A.)
|
Week_start value
Week_start 値(par_idN1067A.)
|
Explanation
説明(par_idN10680.)
|
|
0
0(par_idN10687.)
|
Use system default value
システムのデフォルト値を使用(par_idN1068D.)
|
|
1
1(par_idN10694.)
|
Sunday (default)
日曜日 (デフォルト)(par_idN1069A.)
|
|
2
2(par_idN106A1.)
|
Monday
月曜日(par_idN106A7.)
|
|
3
3(par_idN106AE.)
|
Tuesday
火曜日(par_idN106B4.)
|
|
4
4(par_idN106BB.)
|
Wednesday
水曜日(par_idN106C1.)
|
|
5
5(par_idN106C8.)
|
Thursday
木曜日(par_idN106CE.)
|
|
6
6(par_idN106D5.)
|
Friday
金曜日(par_idN106DB.)
|
|
7
7(par_idN106E2.)
|
Saturday
土曜日(par_idN106E8.)
|
Year_start - An optional parameter that specifies the starting week of a year.
Year_start - 年の開始週を指定するオプションのパラメータ。 (par_idN106EB.)
|
Year_start value
Year_start 値(par_idN106FB.)
|
Explanation
説明(par_idN10701.)
|
|
0
0(par_idN10708.)
|
Use system default value
システムのデフォルト値を使用(par_idN1070E.)
|
|
1
1(par_idN10715.)
|
Week 1 is the week with January, 1st (default)
Week 1 は 1 月 1 日を含む週 (デフォルト)(par_idN1071B.)
|
|
2
2(par_idN10722.)
|
Week 1 is the first week containing four or more days of that year
Week 1 は、その年の 4 日以上を含む最初の週(par_idN10728.)
|
|
3
3(par_idN1072F.)
|
Week 1 is the first week containing only days of the new year
Week 1 は、新年の日付のみを含む最初の週(par_idN10735.)
|
(/embed text/sbasic/shared/03030120.xhp#weekyear)
Example:
例:(par_idN10611.)
Sub example_datepart
Sub example_datepart(par_idN10615.)
msgbox DatePart("ww", "12/31/2005")
msgbox DatePart("ww", "12/31/2005")(par_idN10618.)
End Sub
End Sub(par_idN1061B.)
< Prev /
Next >